package com.yusys.method;

public class T extends Thread {

    @Override
    public void run() {
        while (true) {
            for (int i = 0; i < 5; i++) {
                System.out.println(Thread.currentThread().getName() + "吃包子~~~" + i);
            }

            try {
                System.out.println(Thread.currentThread().getName() + "休眠中~~~");
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                // 当该线程执行到一个interrupt方法时，就会catch一个异常，可以加入自己的业务代码
                System.out.println(Thread.currentThread().getName() + "被 interrupted~~~");
            }
        }
    }
}
